﻿namespace PoolKit
{
    /// <summary>
    /// Strategy able of repairing a broken resource (a resource with inconsistent state)
    /// </summary>
    /// <typeparam name="TResource">Type of resource the strategy can handle</typeparam>
    public abstract class RepairStrategy<TResource> : ResourceStrategy
    {
        /// <summary>
        /// Repairs a broken resource or creates a replacement for it
        /// </summary>
        /// <param name="resource">Resource to repair</param>
        /// <returns>Repaired resource or a replacement for it</returns>
        public abstract TResource Repair(TResource resource);
    }
}